<?php
class Adminmain_model extends Base_Model
{
    public function __construct()
    {
        parent::__construct();
        $this->load->database();
        $this->load->model('redis_model');
    }

    public function getUserCount()
    {
        return $this->db->count_all_results('mod_user');
    }
    /**
     *问答社区问题数
     */
    public function getQuestionCount()
    {
        return $this->db->count_all_results('comm_question');
    }

    /**
     *问答社区今日实时日活
     */
    public function getCommDau()
    {
        $today=date('Ymd',time());
        return $this->redis_model->bitcount('commlogin:'.$today);
    }
    public function getCommDsign()
    {
        $today=date('Ymd',time());
        return $this->redis_model->bitcount('user:'.$today.'.sign');
    }
    /**
     *问答社区今日实时分享
     */
    public function getCommDshare()
    {
        return $this->redis_model->llen('shareoplist');
    }
    /**
     *问答社区今日实时充值
     */
    public function getCommDpay()
    {
        return $this->redis_model->llen('wxpaytrans');
    }

}